<?php

namespace App\Filament\Widgets;

use App\Models\Article;
use App\Models\Author;
use App\Models\Message;
use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;

class ArticleOverview extends BaseWidget
{
    protected static ?string $pollingInterval = '60s';

    protected function getStats(): array
    {
        return [
            Stat::make(__('menu.article_group.article'), Article::query()->count() . ' 篇')
                ->description('32k increase'),
            Stat::make(__('menu.article_group.author'), Author::query()->count() . ' 人')
                ->description('32k increase'),
            Stat::make(__('menu.website_group.message'), Message::query()->count() . ' 条')
                ->description('32k increase'),
        ];
    }
}
